package com.manager.web;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.manager.pojo.User;

public class UserMain {
    public static void main(String[] args) {
//        User xiaoming = new User(5, "xiaoming");
//        String s = JSONObject.toJSONString(xiaoming);
//        System.out.println(s);
//        User user = JSON.toJavaObject((JSON) JSON.parse(s), User.class);
//        System.out.println(user);
        User xiaoming = new User(5, "xiaoming");
        String s = JSON.toJSONString(xiaoming);
        System.out.println(s);
        User user = JSON.toJavaObject((JSON) JSON.parse(s), User.class);
        System.out.println(user);
    }
}
